export function getToken() {
  return window.localStorage.token
}

export function setToken(token) {
  window.localStorage.token = token
}

export function removeToken() {
  window.localStorage.token = ''
}
export function getUserInfo() {
  return JSON.parse(window.localStorage.userInfo) || {}
}

export function setUserInfo(data) {
  return (window.localStorage.userInfo = JSON.stringify(data || {}))
}

export function suppArray(array, lineNum = 5) {
  if (array && array.length) {
    const len = array.length
    const arrLength = lineNum - (len % lineNum)
    const arr = Array.from(new Array(arrLength).fill({}))
    return (array = array.concat(arr))
  } else {
    return []
  }
}
